﻿using Bettzueche.RLLibrary.RLTypes;

namespace Bettzueche.RLLibrary.RLComponent
{
    
    /// <summary>
    /// 
    /// </summary>
    public abstract class AbstractEnvironment {


        /// <summary>
        /// Does the action.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="nextState">State of the next.</param>
        /// <returns>reward</returns>
        public abstract double DoAction(GeneralAction action, out GeneralState nextState);
        

        /// <summary>
        /// Initialize the environment.<para>
        /// Override this method, to do your own specific initialisation
        /// </para>
        /// </summary>
        /// <returns>Empty default Task Specification.</returns>
        public virtual TaskSpec Init() {
            return new TaskSpec();
        }


        /// <summary>
        /// Starts this instance.<para>
        /// Override this method, to do your own stuff.
        /// </para>
        /// </summary>
        /// <returns>The initial state (a <see cref="RLProject1.Model.RLTypes.GeneralState">GeneralState</see>)</returns>
        public virtual GeneralState Start()
        {
            return new GeneralState();
        }


        /// <summary>
        /// Cleans up.<para>
        /// Override this method, to do your own stuff.
        /// </para>
        /// </summary>
        public virtual void CleanUp() {
        }


        /// <summary>
        /// Messages the specified message.<para>
        /// Override this method, to do your own stuff.
        /// </para>
        /// </summary>
        /// <param name="message">The message.</param>
        /// <returns>Response message (Empty String)</returns>
        public virtual string Message(string message) {
            return "";
        }
    }
}
